/* ==============================================================================
 * 创 建 者：
 * 创建日期：2018-4-15
 * 功能描述：首页

 * 修 改 人:
 * 修改时间:
 * 修改描述： 
 * ==============================================================================*/

//激活
var Activate = baseUrl + 'MemberF/Activeted';

var upgradeOid = getURLParameter('oid')
var vu;
$(function() {

	initVue();
});

function initVue() {
	vu = new Vue({
		el: "#content",
		data: {
			Balance: [],
			GradeList: [],
			activeType: [],
			Name: '',
			itemValue: '',
			itemValueoid: '',
			GradeName:'',
		},
		mounted: function() {
			this.Activateget();
		},
		methods: {
			Activateget: function() {
				var _this = this;
				common.get(Activate, {
					memberOID: upgradeOid
				}, 'json', function(r) {
					if(r.ErrorCode == 0) {
						_this.Balance = r.Data.Balance;
						_this.GradeList = r.Data.GradeList;
						_this.activeType = r.Data.activeType;
						_this.Name = r.Data.Name;
						_this.GradeName = r.Data.GradeName;

					} else {
						mui.toast(r.ErrorMsg);
					}
				})
			},
			Activates: function() {
				var _this = this;
				common.post(Activate, {
					MemberOID: upgradeOid,
					activeType: vu.itemValue,
					GradeOID: vu.itemValueoid,
				}, 'json', function(r) {
					console.log(r)
					if(r.ErrorCode == 0||r.ErrorCode == 1) {
//						mui.toast(r.ErrorMsg);
						
//						setTimeout(function(){
//							location.href='registerIn.html';
//						},1500)
						mui.toast('激活成功!即将跳转至升级列表..');
//						setTimeout(function () {
//						    location.href = 'Teamupdate.html';
//						}, 1000);
					} else {
						mui.toast(r.ErrorMsg);
					}
				})
			}

		}

	})

}